package com.edu.exam.entity.curriculum.academic.enums;

import com.edu.exam.enums.core.StatusEnum;

/**
 * 专业状态枚举
 */
public enum MajorStatus implements StatusEnum {
    ACTIVE("ACTIVE", "启用"),
    INACTIVE("INACTIVE", "停用"),
    DELETED("DELETED", "删除");

    private final String code;
    private final String description;

    MajorStatus(String code, String description) {
        this.code = code;
        this.description = description;
    }
    
    @Override
    public String getCode() {
        return code;
    }
    
    @Override
    public String getDescription() {
        return description;
    }
    
    public static MajorStatus fromCode(String code) {
        if (code == null) {
            return null;
        }
        for (MajorStatus status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}